//防抖节流
let timeout, result;
const debounce = function (func) {
    let args = arguments;
    console.log(args);
    if (timeout) {
        clearTimeout(timeout)
    }
    let callNow = !timeout
    timeout = setTimeout(() => {
        timeout = null;
    }, 3000)
    if (callNow) {
        // result = func.apply(this, args) //如this指向有问题再开启 并注释下一行
        result = func(...args)
    }
    return result
}

export default {
      debounce 
}